﻿<UserControl x:Class="GW2PAO.Views.Teamspeak.TSNotificationView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
             xmlns:converters="clr-namespace:GW2PAO.Style.Converters"
             xmlns:core="clr-namespace:GW2PAO.PresentationCore;assembly=GW2PAO.PresentationCore"
             mc:Ignorable="d" d:DesignHeight="35" d:DesignWidth="200"
             TextOptions.TextFormattingMode="Display">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../../Style/ResourceLibrary.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <converters:TSNotificationTypeImageSrcConverter x:Key="NotificationTypeImgSrcConverter" />

            <core:AutoRefreshCollectionViewSource Source="{Binding Paths}" x:Key="PathsCollection" />
            <Geometry x:Key="PathCheckboxGeometry">M 0 6 L 5 12 L 12 0 L 12 0</Geometry>
        </ResourceDictionary>
    </UserControl.Resources>

    <!--<UserControl.ContextMenu>
        <ContextMenu>
            <MenuItem Header="Hide" Command="{Binding HideCommand}" />
            <Separator />
            <MenuItem Header="{Binding MinimumLevel}" IsEnabled="False" />
            <MenuItem Header="{Binding ZoneName}" IsEnabled="False" />
            <MenuItem Header="Copy Waypoint Code" Command="{Binding CopyWaypointCommand}" />
            <MenuItem Header="Open Wiki Page" Command="{Binding OpenWikiPageCommand}" />
        </ContextMenu>
    </UserControl.ContextMenu>-->

    <!--Note: DataContext is set by the TeamspeakView-->
    <Border CornerRadius="0" Margin="0,0,5,0" Padding="10,0,0,0" BorderThickness="0,0,0,0">

        <Border.BorderBrush>
            <LinearGradientBrush Opacity="0.65">
                <GradientStop Color="#FFFFA500" Offset="0.5"/>
                <GradientStop Color="#00FFA500" Offset="1"/>
            </LinearGradientBrush>
        </Border.BorderBrush>

        <Border.Background>
            <SolidColorBrush Color="#00FFFFFF" />
        </Border.Background>

        <Grid Margin="0,5,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            
            <Image Grid.Row="0" Grid.Column="0"
                   HorizontalAlignment="Center" VerticalAlignment="Center"
                   Source="{Binding NotificationType, Converter={StaticResource NotificationTypeImgSrcConverter}}" />

            <core:OutlinedTextBlock Name="User"
                                    Grid.Row="0" Grid.Column="1"
                                    VerticalAlignment="Center" HorizontalAlignment="Left"
                                    FontSize="12"
                                    Margin="5,0,0,0"
                                    Text="{Binding User}" />

            <core:OutlinedTextBlock Grid.Row="0" Grid.Column="2"
                                    VerticalAlignment="Center" HorizontalAlignment="Left"
                                    FontSize="12"
                                    Margin="3,0,0,0">
                <core:OutlinedTextBlock.Style>
                    <Style TargetType="core:OutlinedTextBlock" BasedOn="{StaticResource {x:Type core:OutlinedTextBlock}}">
                        <Setter Property="Text" Value=""/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding NotificationType}" Value="UserEntered">
                                <DataTrigger.Setters>
                                    <Setter Property="Text" Value="entered"/>
                                </DataTrigger.Setters>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding NotificationType}" Value="UserExited">
                                <DataTrigger.Setters>
                                    <Setter Property="Text" Value="exited"/>
                                </DataTrigger.Setters>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </core:OutlinedTextBlock.Style>
            </core:OutlinedTextBlock>

            <core:OutlinedTextBlock Name="Message"
                                    Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3"
                                    VerticalAlignment="Center" HorizontalAlignment="Left"
                                    FontSize="11"
                                    Margin="5,0,0,0"
                                    Text="{Binding Message}" />
        </Grid>
    </Border>
</UserControl>
